<template>
  <div>
    <div class="popup" v-if="fatLists">
      <div class="picture">
        <ul>
          <li v-for="(item,index) in twelvePicture" :key="index">
            <img :src="item" alt="" />
          </li>
        </ul>
      </div>
      <div class="popup-article">
        <div class="article-title">
          <h3>{{fatLists[0].fatTitle}}</h3>
        </div>
        <div class="article-text">
          <p>
            {{fatLists[0].texts.fatTextOne}}
          </p>
          <p>
            {{fatLists[0].texts.fatTextTwo}}
          </p>

          <div class="plan">
            <div class="plan-son">
              <p>·计划包含·</p>
              <p>{{fatLists[0].plan}}</p>
            </div>
          </div>
          <p>{{fatLists[0].texts.fatTextFress}}</p>
          <p>{{fatLists[0].texts.fatTextFout}}</p>
        </div>

        <div class="expert">
          <div class="expert-title">专家介绍</div>
          <div class="expert-son">
            <div class="expert-name" v-for="(item,index) in fatLists[0].expert" :key="index">
              <p>{{item.name}}</p>
              <p>{{item.background}}</p>
            </div>
          </div>
        </div>
        <div class="fit">
          <div class="fit-titel">适合人群</div>
          <div class="fit-text">
            <p v-for="(k,i) in fatLists[0].fit" :key="i">●{{k}}</p>
          </div>
        </div>
        <div class="unsuited">
          <div class="unsuited-titel">不适合人群</div>
          <div class="unsuited-text">
            <p v-for="(k,i) in fatLists[0].unsuited" :key="i">●{{k}}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {fatData} from "../api/fat"
export default {
  name: "popupData",
  data() {
    return {
      twelvePicture: null,
      fatId:1,
      fatLists:null
    };
  },
  created(){
    this.fatId=JSON.parse(window.localStorage.getItem("fatId"))
    console.log(this.fatId);
    fatData().then(data=>{
      this.twelvePicture=data.twelvePictures
      this.fatLists=data.fatLists.filter(item=>item.id==this.fatId)
    })
  }
};
</script>

<style>
@import "../assets/css/public.css";
.picture ul {
  display: flex;
  flex-wrap: wrap;
}
.picture ul li {
  width: 78px;
  height: 78px;
  overflow: hidden;
  border-radius: 16px;
  margin-left: 12px;
}
.picture ul li img {
  width: 100%;
  height: 100%;
}
.popup-article .article-title {
  height: 142px;
  text-align: center;
  padding: 0 38px;
  display: flex;
  align-items: center;
}
.popup-article .article-title h3 {
  font-size: 23px;
}
.popup-article .article-text {
  padding: 0 25px;
}
.popup-article .article-text p {
  font-size: 15px;
}
.popup-article .article-text > p:nth-child(1) {
  margin-bottom: 40px;
}
.popup-article .article-text .plan {
  height: 200px;
  display: flex;
  align-items: center;
}
.popup-article .article-text .plan .plan-son {
  width: 100%;
  height: 83px;
  background-color: #f2f2f2;
  border-radius: 10px;
  padding-top: 30px;
}
.popup-article .article-text .plan .plan-son p {
  text-align: center;
  margin: auto 0;
}
.popup-article .article-text .plan .plan-son p:nth-child(1) {
  font-weight: bold;
  margin-bottom: 16px;
}
.popup-article .expert {
  padding: 0 25px;
}
.popup-article .expert .expert-title {
  height: 77px;
  line-height: 77px;
  font-size: 20px;
  font-weight: bold;
}
.popup-article .expert .expert-son {
  background-color: #f2f2f2;
  text-align: center;
  padding-bottom: 27px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.popup-article .expert .expert-son .expert-name {
  padding: 27px 22px 0 22px;
}
.popup-article .expert .expert-son p:nth-child(1) {
  color: #bbbbbb;
}

.fit .fit-titel,
.unsuited .unsuited-titel {
  padding: 0 25px;
  height: 80px;
  line-height: 80px;
  font-size: 20px;
  font-weight: bold;
}
.fit .fit-text,
.unsuited .unsuited-text {
  padding: 0 25px 0 40px;
}
</style>